<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>您正在添加用户</title>
		<script src="../js/global.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<!--
        	作者：offline
        	时间：2019-06-24
        	描述：添加
        -->
<div id="user_add" style="margin-top: 30px;">
	<form id="formCreateUser" class="layui-form"  action="">
    	<div class="layui-form-item">
            <label class="layui-form-label"><span style="color: red;">*</span>登录名:</label>
            <div class="layui-input-inline" style="width:350px;">
                <input type="text" id="LoginName" placeholder="请输入用户名" name="loginName" 
                	lay-verify="required" class="layui-input" >
            </div>            
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span style="color: red;">*</span>密码:</label>
            <div class="layui-input-inline" style="width:350px;">
                <input type="password" id="userpwd" name="pwd" placeholder="请输入密码" 
                	lay-verify="required" class="layui-input" >
            </div>                    
        </div>
        <div class="layui-form-item">                   
             <label class="layui-form-label"><span style="color: red;">*</span>邮箱:</label>
            <div class="layui-input-inline" style="width:350px;">
                <input type="text" id="ProtectEMail" name="email" placeholder="请输入邮箱" 
                	lay-verify="email" autocomplete="off" class="layui-input">
            </div>
        </div>	 
		<div class="layui-form-item">                   
             <label class="layui-form-label"><span style="color: red;">*</span>手机号:</label>
            <div class="layui-input-inline" style="width:350px;">
                <input type="text" id="ProtectMTel" name="mtel" placeholder="请输入手机号" 
                	lay-verify="required|phone" autocomplete="off" class="layui-input">
            </div>
        </div>	
        <div class="layui-btn-container" style="text-align:center;">
            <button  class="layui-btn" id="transmit"  lay-submit="" lay-filter="adduser">添加</button>	     
    	</div>
	</form>   			
</div>
<script type="text/javascript">
	layui.use(['layer', 'form'], function(){
		var $ = layui.$//jquery
		,layer = layui.layer //弹层
		,form = layui.form //表单					
		form.on('submit(adduser)', function(data) {
			var str = $("#formCreateUser").serialize() + "&token=" + globalData.myToken;
			$.post(""+globalData.server+"CreateUser",str,function(result){							
				if(result.success){	
					layer.alert("添加成功!");
					parent.$("#search").click();
		    		parent.layer.close(index);
				}else{
					layer.alert(result.message);
				}
			},"json");
		   	return false;
		});
	});
</script>
	</body>
</html>
